macOS support: bring-up, native menu, ad-hoc packaging#3
Open
vozzhaevsn wants to merge 1 commit into
Open
Conversation
Run and package Kadr on Apple Silicon, with Mac-native UX and a local
ad-hoc-signed .app/.dmg.
Bring-up
- node-pty rebuilds cleanly on Node 25 / Electron 31 (no version pin).
Mac-native (electron/)
- main.ts: fixUserPath() adopts the user's login-shell PATH on packaged
macOS launches before anything spawns. Finder gives GUI apps a minimal
PATH, which made the Claude PTY exit instantly ("session ended") and
would also break node (MCP bridge), ffmpeg/ffprobe and python3.
- main.ts: VAAPI hardware-codec switches are now Linux-only (macOS uses
native VideoToolbox; the flags only risked the GPU sandbox off-platform).
- menu.ts: real macOS application menu. File/Undo/Redo forward to the
renderer over menu:command with CmdOrCtrl accelerators (fixes the
missing Cmd shortcuts — the old keydown handler only checked ctrlKey);
clipboard/selection keep native roles so text fields and the Claude
terminal behave correctly.
- preload.ts + shared/types.ts: onMenuCommand IPC bridge.
- App.tsx: dispatch menu commands to the existing toolbar handlers
(undo/redo defer to native text undo when an input is focused); drop the
Save/Undo/Redo keydown branches the menu now owns.
Packaging
- electron-builder.yml: asar:false (the app spawns mcp-bridge.cjs and
transcribe.py by absolute path), arm64 dmg+zip, ad-hoc signing.
- build/make-icon.mjs: generates the placeholder icon + .icns.
- package.json: icon and package:mac scripts; electron-builder devDep.
Note: installs need an Electron mirror on GitHub-throttled networks
(ELECTRON_MIRROR). See docs/superpowers/specs for full design + evidence.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Runs and packages Kadr on Apple Silicon, adds Mac-native UX, and produces a local ad-hoc-signed
.app/.dmg.Bring-up
node-ptyrebuilds cleanly on Node 25 / Electron 31 — no version pin needed.Mac-native (
electron/)fixUserPath()(main.ts): on packaged macOS launches, adopt the user's login-shellPATHbefore anything spawns. Finder gives GUI apps a minimalPATH, which made the embedded Claude PTY exit instantly ("session ended") and would also breaknode(MCP bridge),ffmpeg/ffprobe, andpython3.menu.ts: real macOS application menu. File / Undo / Redo forward to the renderer overmenu:commandwithCmdOrCtrlaccelerators (fixes the missing ⌘ shortcuts — the old keydown handler only checkedctrlKey); clipboard/selection keep native roles so text fields and the Claude terminal behave correctly.preload.ts+shared/types.ts:onMenuCommandIPC bridge.App.tsx: dispatch menu commands to the existing toolbar handlers (undo/redo defer to native text undo when an input is focused); drop the Save/Undo/Redo keydown branches the menu now owns.Packaging
electron-builder.yml:asar:false(the app spawnsmcp-bridge.cjsandtranscribe.pyby absolute path), arm64dmg+zip, ad-hoc signing.build/make-icon.mjs: generates a placeholder icon +.icns.package.json:iconandpackage:macscripts;electron-builderdevDep.Verification
npm run typecheckclean; dev run renders the editor..applaunches fromfile://, renders, and the embedded Claude Code terminal starts inside the bundle (node-pty + PTY +claudespawn all work packaged).fixUserPathverified under a scrubbed minimalPATH:claudeOpen → {ok:true}, session stays alive.🤖 Generated with Claude Code